﻿using DAL;
using MD5Hash;
using Model;

namespace BLL
{
    public class HUiyuanBLL
    {
        public HUiyuanBLL (HuiyuanDAL huiyuanDAL)
        {
            HuiyuanDAL = huiyuanDAL;
        }
        
        public HuiyuanDAL HuiyuanDAL { get; }
        /// <summary>
        /// 添加
        /// </summary>
        public int Add(Huiyuan huiyuan)
        {
            return HuiyuanDAL.Add(huiyuan);
        }
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public int Login(string username, string password)
        {
            return HuiyuanDAL.Login(username, password);
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        public List<Huiyuan> GetHuiyuans()
        {
            return HuiyuanDAL.GetHuiyuans();
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int Delete(int id)
        {
            
            return HuiyuanDAL.Delete(id);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="huiyuan"></param>
        /// <returns></returns>
        public int Update(Huiyuan huiyuan)
        {
            
            return HuiyuanDAL.Update(huiyuan);
        }
        /// <summary>
        /// 反添
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Huiyuan GetHuiyuan(int id)
        {
            return HuiyuanDAL.GetHuiyuan(id);
        }
    }
}
